//
//  UIImageView+Conveniently.m
//  app
//
//  Created by 刘华舟 on 15/7/15.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//

#import "UIImageView+Conveniently.h"

@implementation UIImageView (Conveniently)

- (void)setFadeOutImageURL:(NSString *)url placehoderImage:(UIImage *)placehoderImage duration:(NSTimeInterval) duration{
    //图像的动画特效
    [self sd_setImageWithURL:[NSURL URLWithString:url] placeholderImage:placehoderImage options:SDWebImageRetryFailed progress:^(NSInteger receivedSize, NSInteger expectedSize) {
        
    } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        if (cacheType != SDImageCacheTypeMemory) {
            self.alpha = 0.0f;
            [UIView animateWithDuration:duration animations:^{
                self.alpha = 1.0f;
            }];
        }
    }];
}

@end
